Optimal. Leaf size=52 \[ -\frac{a \cot ^3(c+d x)}{3 d}+\frac{b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{b \cot (c+d x) \csc (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.109089, antiderivative size = 52, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.185, Rules used = {2838, 2607, 30, 2611, 3770} \[ -\frac{a \cot ^3(c+d x)}{3 d}+\frac{b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{b \cot (c+d x) \csc (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2838
Rule 2607
Rule 30
Rule 2611
Rule 3770
Rubi steps
\begin{align*} \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x)) \, dx &=a \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx+b \int \cot ^2(c+d x) \csc (c+d x) \, dx\\ &=-\frac{b \cot (c+d x) \csc (c+d x)}{2 d}-\frac{1}{2} b \int \csc (c+d x) \, dx+\frac{a \operatorname{Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=\frac{b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a \cot ^3(c+d x)}{3 d}-\frac{b \cot (c+d x) \csc (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0361305, size = 95, normalized size = 1.83 \[ -\frac{a \cot ^3(c+d x)}{3 d}-\frac{b \csc ^2\left (\frac{1}{2} (c+d x)\right )}{8 d}+\frac{b \sec ^2\left (\frac{1}{2} (c+d x)\right )}{8 d}-\frac{b \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{2 d}+\frac{b \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.054, size = 80, normalized size = 1.5 \begin{align*} -{\frac{a \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{3\,d \left ( \sin \left ( dx+c \right ) \right ) ^{3}}}-{\frac{b \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}}}-{\frac{b\cos \left ( dx+c \right ) }{2\,d}}-{\frac{b\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{2\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.1028, size = 82, normalized size = 1.58 \begin{align*} \frac{3 \, b{\left (\frac{2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - \frac{4 \, a}{\tan \left (d x + c\right )^{3}}}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.35262, size = 316, normalized size = 6.08 \begin{align*} \frac{4 \, a \cos \left (d x + c\right )^{3} + 6 \, b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \,{\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 3 \,{\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right )}{12 \,{\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.26198, size = 155, normalized size = 2.98 \begin{align*} \frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 3 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 \, b \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + \frac{22 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 3 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3}}}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]